package com.jd.jstable.test;

import com.jd.jstable.annotation.HighAvailability;
import com.jd.jstable.annotation.HighPerformance;
import com.jd.jstable.config.KeyMode;
import org.springframework.stereotype.Service;

/**
 * Created by chenyipu on 2018/6/6.
 */
@Service
public class MixClass {

    int i = 0 ;
    @HighAvailability(strategies = "_redis:SECONDS-18", key_mode = KeyMode.SOME_ARG, prefix = "TEST2")
    @HighPerformance(strategies = "_redis:SECONDS-8", key_mode = KeyMode.SOME_ARG, prefix = "TEST1")
     public String a(String a) throws Exception{
        if(i>0){
            throw new Exception("boom");
        }
        i++;
        return "here" + System.currentTimeMillis();
    }
}
